<template>
	<view>
		<HMfilterDropdown :filterData="filterData" :defaultSelected ="filterDropdownValue" @confirm="confirm"></HMfilterDropdown>
		<view class="space"></view>
		<cateList ref="clist"></cateList>
	</view>
</template>

<script>
	import cateList from "../../list/category-list/category-list.vue"
	import HMfilterDropdown from '@/components/HM-filterDropdown/HM-filterDropdown.vue';
	export default {
		components:{
			cateList,
			'HMfilterDropdown':HMfilterDropdown 
		},
		data(){
				 return {
				   filterData:[{
					   "name":"排序",
					   "type":"hierarchy",
					   "submenu":[{
						   "name":"最热门",
						   "value":1
					   },
					   {
						   "name":"最新",
						   "value":2
					   }
					   ]
				   }]
				 }
			},
			methods:{
				confirm(e){
					console.log(e)
					if(e.index[0][0]==1){
						this.$refs.clist.getNewCategories()
					}else{
						this.$refs.clist.getHotCategories()
					}
					
				}
			}
		
		
	}
</script>

<style lang="less">
	.space{
		min-height:50px;
		min-width:100%;
	}
</style>
